#ifndef GLOBALFUNC_H
#define GLOBALFUNC_H

#include "stdafx.h"
#include "CVHeader.h"
#include "ImageHandler.h"
#include "HLUtility.h"
#include "GlobalHeader.h"

#include <iostream>
using namespace std;
using namespace HLCAO;
using namespace cv;

namespace GlobalFunc
{
	void			TraceGridValue(IplImage* pImg, GRID_POS jGPos, GRID_POS iGPos );
	void			TraceImageValue(IplImage* pImage);
	void			PrintByteInBinary(uchar theChar);
	void			TraceMatValue(CvMat* mat);
	MatchResult		TemplateMatching( ImageHandler& imgTemplate, 
									  ImageHandler& imgTarget, 
									  ImageHandler& depTemplate, 
									  ImageHandler& depTarget);
	void			LabelGradient(ImageHandler& imageHandler, int threshold);

	void			TestWithTemplateMatching(ImageHandler& imgTemplateHandler, ImageHandler& depTemplateHandler);
	void			CapWithKinect();
	void			CapWithCamera();

	IplImage*		convertTo32FImg(IplImage* src);
	void			buildMouseCallBack(int mouseEvent, int x, int y, int flags, void* param);
	void			grapTemplateImage(CvPoint startPoint, CvPoint endPoint, IplImage* greyImage, IplImage* depthImage);
	IplImage*		scaleToGreyScale(IplImage* src );
	IplImage*       buildMaskImage(IplImage* rgbTmpalte,
									IplImage* rgbBack,
									IplImage* depTemplate,
									IplImage* depBack);
}

#endif


